package dataModifiers;

import java.util.List;

import inputs.Input;

/**
 * HighPass Modifier class
 * Extends Modifier functionality
 * 
 * Inputs:
 * 		0: The value to be passed
 * 		1: The value to be tested, and output if higher than Input 0.
 * 
 * Outputs Input 1 if it is larger than Input 0.
 * 		Else, outputs -1.
 * 
 * @author Dylan James
 *
 */
public class HighPass extends Modifier {
	
	public HighPass(List<Input> inputs)
	{
		super(inputs);
	}
	
	@Override
	protected void Initialize() {
	}
	
	@Override
	protected void AccountForInputs() {
		if (inputs.size() < 2)
		{
			this.min = 0;
			this.max = 0;
		}
		else
		{
			Input input = inputs.get(1);
			this.min = input.getMin();
			this.max = input.getMax();
		}
	}

	@Override
	protected void Update() {
		this.value = -1;

		if (inputs.size() > 1)
		{
			if (inputs.get(0).getValue() < inputs.get(1).getValue())
				this.value = inputs.get(1).getValue();
		}
	}

}
